using System;
using DotNetNuke;
using System.Data;

using DotNetNuke.Framework;

namespace PT.MuaBanXe
{
    /// -----------------------------------------------------------------------------
    /// <summary>
    /// An abstract class that provides the DAL contract
    /// </summary>
    /// <remarks>
    /// </remarks>
    /// <history>
    /// </history>
    /// -----------------------------------------------------------------------------
    public abstract class DataProvider
    {

        #region Shared/Static Methods

        // singleton reference to the instantiated object 
        static DataProvider objProvider = null;

        // constructor
        static DataProvider()
        {
            CreateProvider();
        }

        // dynamically create provider
        private static void CreateProvider()
        {
            objProvider = (DataProvider)Reflection.CreateObject("data", "PT.MuaBanXe", "");
        }

        // return the provider
        public static DataProvider Instance()
        {
            return objProvider;
        }

        #endregion

        #region Abstract methods

        public abstract IDataReader GetCarMuaBanXe(int ItemId);
        public abstract IDataReader GetCarMuaBanXeList();
        public abstract void InsertUpdateCarMuaBanXe(int ModuleId, int ItemId, string CarName, string CarManufacture, string CarType, string Price, string ImageURL, string OtherInfo, string Specification,string ContactInformation, int UserId);
        public abstract void DeleteCarMuaBanXe(int ItemId);

        #endregion


    }
}
